{% load static %}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es-es" lang="es-es" dir="ltr">

	<head>
		<link rel="stylesheet" href="{% get_static_prefix %}css/style.css" type="text/css" />
        <script type="text/javascript" src="{% get_static_prefix %}js/jquery.js"></script>
        <script type="text/javascript" src="{% get_static_prefix %}js/formset.js"></script>
		<title>Simulador Salarial ADIUC</title>
	</head>
	
	<body>
	    
		<form action="/calculate/" method="POST">

            <!-- Requerido para contabilizar cuantos forms tiene el formset -->
            {{ univformset.management_form }}

			<div id="form_content">

				<div id="form_mes">
					{{ mform.aumento}}
				</div>

                {% for univform in univformset %}

				<div class="form_cargo">
					<table>
						<tr>

							<td> {{ univform.cargo.label_tag }}: </td>
							<td> {{ univform.cargo }} </td>

						</tr>
						<tr>

							<td> {{ univform.antiguedad.label_tag }}:</td>
							<td> {{ univform.antiguedad }} </td>

						</tr>
						<tr>
							<td>T&iacute;tulos adicionales:</td>
						</tr>
						<tr colspand=2>
							<td><blockquote>

								{{ univform.master }} {{ univform.master.label_tag }} 

								<br>

								{{ univform.doctorado }} {{ univform.doctorado.label_tag }}

								</blockquote>
							</td>
						</tr>
					</table>
                    <p class="agregar_quitar rightalign"><a href="javascript:null" onclick="hide_father(this,univPrefix)">Quitar</a></p>
				</div>

                {% endfor %}

				<a id="nuevo_cargo" class="agregar_quitar" href="javascript:null" onclick="show_new_form_HTML('form_content', univDivAttrs,
                '<table>\
                        <tr>\
                            <td> {{ univformset.empty_form.cargo.label_tag|escapejs }}: </td>\
                            <td> {{ univformset.empty_form.cargo|escapejs }} </td>\
						</tr>\
						<tr>\
							<td> {{ univformset.empty_form.antiguedad.label_tag|escapejs }}:</td>\
							<td> {{ univformset.empty_form.antiguedad|escapejs }} </td>\
						</tr>\
						<tr>\
							<td>T&iacute;tulos adicionales:</td>\
						</tr>\
						<tr colspand=2>\
							<td><blockquote>\
								{{ univformset.empty_form.master|escapejs }} {{ univformset.empty_form.master.label_tag|escapejs }}\
								<br>\
								{{ univformset.empty_form.doctorado|escapejs }} {{ univformset.empty_form.doctorado.label_tag|escapejs }}\
								</blockquote>\
							</td>\
						</tr>\
					</table>\
                    <p class=\'agregar_quitar rightalign\'><a href=\'javascript:null\' onclick=\'hide_father(this, univPrefix)\'>Quitar</a></p>',
                univPrefix, 'nuevo_cargo')">[+] A&ntilde;adir nuevo cargo</a>
				<div id="submit"><input type="submit" value="Calcular" /></div>
			</div>
		</form>
    
        <!-- Script para setear valores iniciales de variables luego de cargar el body -->
        <script type="text/javascript">
            univPrefix = "univcargo";
            univDivAttrs = {};
            univDivAttrs['class'] = 'form_cargo';
            formset_init(univPrefix);
        </script>

	</body>

</html>
